#!/usr/bin/env python
#coding=utf-8
import SimpleHTTPServer
import SocketServer

port = 8000
IP = ''

def sayHello():
	return 'Hello'

class CustomHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
	def do_GET(self):
		if self.path == '/hello':
			self.send_response(200)
			self.send_header('Content-type', 'text/html')
			self.end_headers()
			self.wfile.write(sayHello())
			return
		else:
			SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)

http = SocketServer.ThreadingTCPServer((IP, port),CustomHandler)

print 'port=', port
http.serve_forever()